/*
开辟n+2个空间，最后能够到达n+1时即为过关
1.前缀和，先正常推出到每个节点的答案，此时为考虑补给时的答案
再依次枚举，x-1->x->x+1 假定在x处处失去补给，则在x+1处的答案需要在减掉x的补给

2.优化
    -a[i]->+a[i]
    +b[i]->-b[i]
答案存储的是需求量的正数
*/
#include <iostream>
#include <cstring>
using namespace std;
#define DEBUG
inline int read()
{
    int c=getchar(), f=1, x=0;
    if(c=='-') f*=-1;
    while(c<'0'&&'9'<c) c=getchar();
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    return f*x;
}

inline void write(int x)
{
    if(x<0) putchar('-'), x*=-1;
    if(x>=10) write(x/10);
    putchar(x%10+'0');
}
const int N=1e5+10, INF=0x3f3f3f3f;
int n;
int a[N], b[N], dp[N], ans[N], res=INF;

inline void print(int st, int arr[])
{
    for(int i=st; i<=n+1; i++)
        printf("%d ", arr[i]);
    puts("");
}

void init()
{
    n=read();
    for(int i=0; i<=n; i++)
    {    a[i]=-1*read(); dp[i]=a[i];}
    for(int i=1; i<=n; i++)
    {    
        b[i]=read(); 
        dp[i]+=b[i];
        dp[i]+=dp[i-1];
    }
}

void solve()
{
    init();
    
    for(int i=n; i>=0; i--) //倒退从点i出发需要的最低初始
    {
        res=min(dp[i], res);
        ans[i]=res;    
    }
    for(int i=1; i<=n; i++)
    {   
        ans[i]-=b[i]; //不考虑当前补给
        ans[i]=min(ans[i], ans[0]); //找到最小的补给
        ans[i]*=-1; //转为正数
        write(ans[i]); putchar(' ');
    }
    puts("");
}

signed main()
{
    #ifdef DEBUG
        freopen("../in.txt", "r", stdin);
        freopen("../out.txt", "w", stdout);
    #endif

    int T=1; //cin >> T; 
    while(T--) 
    {
        solve();
    }
    return 0;
}